package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import io.swagger.annotations.ApiModelProperty;
import com.liao.badminton.entity.StipulationLevel;
import javax.validation.constraints.NotNull;
import java.util.List;
import lombok.Data;
import com.liao.badminton.code.validation.FindDetail;
import java.lang.String;
import java.math.BigDecimal;
import java.util.Date;

/**
* @author liaocheng
* @date 2024-11-09
* description:等级划分规则表
*/
@Data
public class StipulationLevelDto extends BaseField {

    @ApiModelProperty(value = "id")
    @NotNull(message = "主键id不能为空",groups = {Update.class, FindDetail.class})
    private Long id;

    @ApiModelProperty(value = "群id")
    private Long groupId;

    @ApiModelProperty(value = "赢家名称")
    private String levelName;

    @ApiModelProperty(value = "最低下限包含：比如前5名>=5")
    private BigDecimal scopeLow;

    @ApiModelProperty(value = "最大上限不包含：比如<0")
    private BigDecimal scopeHigh;

    @ApiModelProperty(value = "1.胜率 2.获得奖励 3.名次")
    private Integer stipulationType;

    @ApiModelProperty(value = "stipulation_type=3时，名次排序类型：1.胜率 2.获得奖励 3.净胜分")
    private Integer rankType;

    @ApiModelProperty(value = "作用：比如前5名，要让5分，后5名，要+5分")
    private BigDecimal effect;

    @ApiModelProperty(value = "是否有效：0:无效，1:有效")
    private Integer useStatus;

    @NotNull(message = "主键id不能为空",groups = {Delete.class})
    private List<Long> delIds;  //批量删除ids

    public StipulationLevel invertEntity(){
        StipulationLevel dto = new StipulationLevel();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setGroupId(this.getGroupId());
        dto.setLevelName(this.getLevelName());
        dto.setScopeLow(this.getScopeLow());
        dto.setScopeHigh(this.getScopeHigh());
        dto.setStipulationType(this.getStipulationType());
        dto.setRankType(this.getRankType());
        dto.setEffect(this.getEffect());
        dto.setUseStatus(this.getUseStatus());
        return dto;
    }
}
